package PTA_JAVA.JavaA.Javademo4;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String n = String.valueOf(sc.nextLine()).replaceAll("\\.|\\-","");
            int sum=0;
            for (int i = 0; i < n.length(); i++) {
                sum+=Integer.parseInt(n.substring(i,i+1));
            }
            System.out.println(sum);
        }
    }
}
